package businessServlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.*;

import com.google.appengine.api.datastore.Email;

import controller.Controller;

@SuppressWarnings("serial")
public class ChangeStatusBusiness extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {

	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		int orderID = Integer.parseInt(req.getParameter("orderID"));
		int newStatus = Integer.parseInt(req.getParameter("newStatus"));
		String userName = (String) req.getSession().getAttribute("userNameBusiness");
		
		System.out.println("$#$$$$$$$$$$$$$$$$$$$$$$$$#$"+orderID + " "+ newStatus + " "+ userName);
		
		Controller.getInstance().changeLevelInOrder(userName, orderID, newStatus);
		System.out.println("!!!!!!!! Done Change Status");
		resp.sendRedirect("allOrders.jsp");

	}
	
}
